package cn.lizhangqu.kb.handler;

import org.json.JSONException;
import org.json.JSONObject;

import cn.lizhangqu.kb.model.ArticlesListData;

/**
 * Created by 柯尊诚 on 2015/11/6.
 * kzc
 */
public class ArticlesListDataResponseHandler extends JsonResponseHandler<ArticlesListData> {

    private ReportJsonResponseHandler handler = new ReportJsonResponseHandler();

    @Override
    protected ArticlesListData parseItem(JSONObject json) throws JSONException {

        ArticlesListData data = new ArticlesListData();
        if(hasKeyValue(json, "atArticles")) {
            data.atArticles = handler.parseItems(json.getJSONArray("atArticles"));
        }
//        if(hasKeyValue(json, "paging")) {
////            page.setPaging(new PageJsonResponseHandler().parseItem(json.getJSONObject(JSON_KEY_PAGING)));
//            new PageJsonResponseHandler().parseItem(json.getJSONObject(JSON_KEY_PAGING)
//        }

        return data;
    }
}
